#!/usr/bin/env python
from os import system
import numpy as np


def write_control(t):
    with open('CONTROL','r') as f:
         lines = f.readlines()
    with open('CONTROL','w') as f:
         for line in lines:
             if line.find('T=')>=0:
                f.write('        T= {:.1f} \n'.format(t))
             else:
                f.write(line)

         
for t in [80,100,120,140,160,180,200,250,300,350,400,450,500,550,600,650,700,750,800]:
    write_control(t)
    system('mpirun -n 8 ./ShengBTE >sheng.out')

# export LD_LIBRARY_PATH=/home/feng/mlff/cc/shengbte/spglib/lib/:$LD_LIBRARY_PATH
